/**
 *  Copyright Matt Silbernagel 2010
 *  
 *	This file is part of MobilePrinting.
 *
 *	MobilePrinting is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  MobilePrinting is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with MobilePrinting.  If not, see <http://www.gnu.org/licenses/>.
 */

package edu.uc.labs.MobilePrinting.PrintUtils;

/**
 * 
 * @author Matt Silbernagel
 */
public class Printer {

	private String queue;
	private String server;
	private String name;
	private String ppd;
	private String ppdFileName;
	private String driver;
	private String zone;
	private String location;
	private boolean active = false;
	private boolean empty = true;

	// constructor for printer class
	public Printer() {

	}

	// Override Constructor to accept arguments
	public Printer(String pName, String pQueue, String pServer, String pPPD,
			String pLocation) {
		this.name = pName;
		this.queue = pQueue;
		this.server = pServer;
		this.ppd = pPPD;
		this.location = pLocation;
		this.empty = false;
	}

	// Install the printer
	public void installPrinter() {
		PrinterManager printInstall = new PrinterManager(this);
		printInstall.run();
	}

	/**
	 * @return the queue
	 */
	public String getQueue() {
		return queue;
	}

	/**
	 * @param queue
	 *            the queue to set
	 */
	public void setQueue(String queue) {
		this.empty = false;
		this.queue = queue;
	}

	/**
	 * @return the server
	 */
	public String getServer() {
		return server;
	}

	/**
	 * @param server
	 *            the server to set
	 */
	public void setServer(String server) {
		this.empty = false;
		this.server = server;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.empty = false;
		this.name = name;
	}

	public void setPPD(String ppd) {
		this.empty = false;
		this.ppd = ppd;
	}

	public String getPPD() {
		return this.ppd;
	}
	
	public void setDriver( String driver ){
		this.driver = driver;
	}
	
	public String getDriver(){
		return driver;
	}

	public void setZone(String zone) {
		this.empty = false;
		this.zone = zone;
	}

	public String getZone() {
		return this.zone;
	}

	public void setLocation(String loc) {
		this.empty = false;
		this.location = loc;
	}

	public String getLocation() {
		return this.location;
	}
	
	public void setPPDFileName(String filename){
		this.ppdFileName = filename;
	}
	
	public String getPPDFileName(){
		return this.ppdFileName;
	}

	public String toString() {
		String s = "\n\nName: "   + this.name + 
		 		   "\nLocation: " + this.location +
		 		   "\nServer: "   + this.server + 
				   "\nQueue: "    + this.queue + 
				   "\nDriver: "   + this.driver +
				   "\nZone: "     + this.zone + 
				   "\nPPD: "	  + this.ppd +
				   "\n\n";
		return s;
	}

	public void setActive(boolean a) {
		active = a;
	}

	public boolean isActive() {
		return active;
	}

	public boolean isEmpty() {
		return empty;
	}
}
